package info.liuxing;

import info.liuxing.config.MainConfigOfLifeCycle;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * IOCTest_LifeCycle
 *
 * @author liuxing
 * @summary IOCTest_LifeCycle
 * @Copyright (c) 2018, Lianjia Group All Rights Reserved.
 * @since 2018-04-09 23:58
 */
@Slf4j
public class IOCTest_LifeCycle {

    /**
     * 配置类注册
     */
    @Test
    public void testInject2() {
        // 创建IOC容器
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfigOfLifeCycle.class);
        log.info("容器创建完成");

        // 关闭容器
        applicationContext.destroy();
    }

}
